/*
 * SlowTransmissionSchedule.h
 *
 *  Created on: 2015年7月17日
 *      Author: Administrator
 */

#ifndef BCCH_TRANSSCHEDULE_SLOWTRANSMISSIONSCHEDULE_H_
#define BCCH_TRANSSCHEDULE_SLOWTRANSMISSIONSCHEDULE_H_

#include "../class1/ClassOne.h"
#include "../class4/Class4A.h"
#include "../class2/Class2A.h"
#include "../class3/Class3A.h"
#include "../class3/Class3B.h"
#include "../class3/Class3C.h"
#include "../class2/Class2B.h"
#include "../class3/Class3D.h"
#include "../class3/Class3E.h"
#include "../class3/Class3F.h"
#include "../class3/Class3G.h"
#include "../class3/Class3H.h"
#include "../class2/Class2B.h"
#include "../class3/Class3I.h"
#include "../class3/Class3J.h"


//其中<Block Header>::=
//<Protocol version: "0000">
//<Block Type: 1bit> − Set to "1". 标志着此块含Class 1信息
//<Randomization period: 2bits> − 随机化延迟帧周期<m>，表示CHANNEL REQUEST 消息相当于系统信息延迟的帧数.
//00: <m> = 7
//01: <m> = 15
//10: <m> = 23
//11: <m> = 31
//<Spare: 1bit>;
struct blockHeader1{
	unsigned char protocolVersion:4;
	unsigned char blockType:1;
	unsigned char RandomPeriod:2;
	unsigned char spare:1;
};
//其中<Block Header>::=
//<Protocol version 4bit>- "0000"
//<Block Type 1bit>− Set to "0"，表示不包含Class 1信息.
//<Spare 3bit>

struct BlockHeader2{
	unsigned char protocolVersion:4;
	unsigned char blockType:1;
	unsigned char spare:3;
};

struct block1{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class4A class4A;//120bit 本来此处为4n(A,B,C,D,E,F) 用4代替
};

struct block2{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class2A class2A;//184bit
};

struct block3{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3A class3A;//120 bit
};

struct block4{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class3B class3B;//184bit
};

struct block5{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3C class3C;//120 bit
};

struct block6{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class2B class2B;//184bit
};

struct block7{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3D class3D;//120 bit
};

struct block8{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class3E class3E;//184bit
};
struct block9{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class4A class4A;//120bit 本来此处为4n(A,B,C,D,E,F) 用4代替
};

struct block10{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class2A class2A;//184bit
};

struct block11{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3F class3F;//120 bit
};

struct block12{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class3G class3G;//184bit
};
struct block13{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3H class3H;//120bit
};

struct block14{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class2B class2B;//184bit
};

struct block15{
	bool valid;
	blockHeader1 blockHeader;//8bit
	ClassOne class1A;//64bit
	Class3I class3I;//120bit
};

struct block16{
	bool valid;
	BlockHeader2 blockHeader;//8bit
	Class3J class3J;//184bit
};

class SlowTransmissionSchedule {
public:
	SlowTransmissionSchedule();
	virtual ~SlowTransmissionSchedule();

	//初始化
	void slowTransSchInit();
	//通过的传递参数  获取数据
	void fetchBlockInfo(char *pbuff);
	block1 mblock1;
	block2 mblock2;
	block3 mblock3;
	block4 mblock4;
	block5 mblock5;
	block6 mblock6;
	block7 mblock7;
	block8 mblock8;
	block9 mblock9;
	block10 mblock10;
	block11 mblock11;
	block12 mblock12;
	block13 mblock13;
	block14 mblock14;
	block15 mblock15;
	block16 mblock16;

};

#endif /* BCCH_TRANSSCHEDULE_SLOWTRANSMISSIONSCHEDULE_H_ */
